{"ast":null,"code":"import PickerButton from '../PickerButton';\nimport generateRangePicker from './generateRangePicker';\nimport generateSinglePicker from './generateSinglePicker';\nexport var Components = {\n  button: PickerButton\n};\nfunction toArray(list) {\n  if (!list) {\n    return [];\n  }\n  return Array.isArray(list) ? list : [list];\n}\nexport function getTimeProps(props) {\n  var format = props.format,\n    picker = props.picker,\n    showHour = props.showHour,\n    showMinute = props.showMinute,\n    showSecond = props.showSecond,\n    use12Hours = props.use12Hours;\n  var firstFormat = toArray(format)[0];\n  var showTimeObj = Object.assign({}, props);\n  if (firstFormat && typeof firstFormat === 'string') {\n    if (!firstFormat.includes('s') && showSecond === undefined) {\n      showTimeObj.showSecond = false;\n    }\n    if (!firstFormat.includes('m') && showMinute === undefined) {\n      showTimeObj.showMinute = false;\n    }\n    if (!firstFormat.includes('H') && !firstFormat.includes('h') && showHour === undefined) {\n      showTimeObj.showHour = false;\n    }\n    if ((firstFormat.includes('a') || firstFormat.includes('A')) && use12Hours === undefined) {\n      showTimeObj.use12Hours = true;\n    }\n  }\n  if (picker === 'time') {\n    return showTimeObj;\n  }\n  if (typeof firstFormat === 'function') {\n    // format of showTime should use default when format is custom format function\n    delete showTimeObj.format;\n  }\n  return {\n    showTime: showTimeObj\n  };\n}\nvar DataPickerPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'];\nfunction generatePicker(generateConfig) {\n  // =========================== Picker ===========================\n  var _generateSinglePicker = generateSinglePicker(generateConfig),\n    DatePicker = _generateSinglePicker.DatePicker,\n    WeekPicker = _generateSinglePicker.WeekPicker,\n    MonthPicker = _generateSinglePicker.MonthPicker,\n    YearPicker = _generateSinglePicker.YearPicker,\n    TimePicker = _generateSinglePicker.TimePicker,\n    QuarterPicker = _generateSinglePicker.QuarterPicker;\n  // ======================== Range Picker ========================\n  var RangePicker = generateRangePicker(generateConfig);\n  var MergedDatePicker = DatePicker;\n  MergedDatePicker.WeekPicker = WeekPicker;\n  MergedDatePicker.MonthPicker = MonthPicker;\n  MergedDatePicker.YearPicker = YearPicker;\n  MergedDatePicker.RangePicker = RangePicker;\n  MergedDatePicker.TimePicker = TimePicker;\n  MergedDatePicker.QuarterPicker = QuarterPicker;\n  return MergedDatePicker;\n}\nexport default generatePicker;","map":{"version":3,"names":["PickerButton","generateRangePicker","generateSinglePicker","Components","button","toArray","list","Array","isArray","getTimeProps","props","format","picker","showHour","showMinute","showSecond","use12Hours","firstFormat","showTimeObj","Object","assign","includes","undefined","showTime","DataPickerPlacements","generatePicker","generateConfig","DatePicker","WeekPicker","MonthPicker","YearPicker","TimePicker","QuarterPicker","RangePicker","MergedDatePicker"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/date-picker/generatePicker/index.js"],"sourcesContent":["import PickerButton from '../PickerButton';\nimport generateRangePicker from './generateRangePicker';\nimport generateSinglePicker from './generateSinglePicker';\nexport const Components = {\n  button: PickerButton\n};\nfunction toArray(list) {\n  if (!list) {\n    return [];\n  }\n  return Array.isArray(list) ? list : [list];\n}\nexport function getTimeProps(props) {\n  const {\n    format,\n    picker,\n    showHour,\n    showMinute,\n    showSecond,\n    use12Hours\n  } = props;\n  const firstFormat = toArray(format)[0];\n  const showTimeObj = Object.assign({}, props);\n  if (firstFormat && typeof firstFormat === 'string') {\n    if (!firstFormat.includes('s') && showSecond === undefined) {\n      showTimeObj.showSecond = false;\n    }\n    if (!firstFormat.includes('m') && showMinute === undefined) {\n      showTimeObj.showMinute = false;\n    }\n    if (!firstFormat.includes('H') && !firstFormat.includes('h') && showHour === undefined) {\n      showTimeObj.showHour = false;\n    }\n    if ((firstFormat.includes('a') || firstFormat.includes('A')) && use12Hours === undefined) {\n      showTimeObj.use12Hours = true;\n    }\n  }\n  if (picker === 'time') {\n    return showTimeObj;\n  }\n  if (typeof firstFormat === 'function') {\n    // format of showTime should use default when format is custom format function\n    delete showTimeObj.format;\n  }\n  return {\n    showTime: showTimeObj\n  };\n}\nconst DataPickerPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'];\nfunction generatePicker(generateConfig) {\n  // =========================== Picker ===========================\n  const {\n    DatePicker,\n    WeekPicker,\n    MonthPicker,\n    YearPicker,\n    TimePicker,\n    QuarterPicker\n  } = generateSinglePicker(generateConfig);\n  // ======================== Range Picker ========================\n  const RangePicker = generateRangePicker(generateConfig);\n  const MergedDatePicker = DatePicker;\n  MergedDatePicker.WeekPicker = WeekPicker;\n  MergedDatePicker.MonthPicker = MonthPicker;\n  MergedDatePicker.YearPicker = YearPicker;\n  MergedDatePicker.RangePicker = RangePicker;\n  MergedDatePicker.TimePicker = TimePicker;\n  MergedDatePicker.QuarterPicker = QuarterPicker;\n  return MergedDatePicker;\n}\nexport default generatePicker;"],"mappings":"AAAA,OAAOA,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAO,IAAMC,UAAU,GAAG;EACxBC,MAAM,EAAEJ;AACV,CAAC;AACD,SAASK,OAAO,CAACC,IAAI,EAAE;EACrB,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,EAAE;EACX;EACA,OAAOC,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,GAAG,CAACA,IAAI,CAAC;AAC5C;AACA,OAAO,SAASG,YAAY,CAACC,KAAK,EAAE;EAClC,IACEC,MAAM,GAMJD,KAAK,CANPC,MAAM;IACNC,MAAM,GAKJF,KAAK,CALPE,MAAM;IACNC,QAAQ,GAINH,KAAK,CAJPG,QAAQ;IACRC,UAAU,GAGRJ,KAAK,CAHPI,UAAU;IACVC,UAAU,GAERL,KAAK,CAFPK,UAAU;IACVC,UAAU,GACRN,KAAK,CADPM,UAAU;EAEZ,IAAMC,WAAW,GAAGZ,OAAO,CAACM,MAAM,CAAC,CAAC,CAAC,CAAC;EACtC,IAAMO,WAAW,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEV,KAAK,CAAC;EAC5C,IAAI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